#include<bits/stdc++.h>
using namespace std;
int n,a[100005],mx=INT_MIN,mn=INT_MAX,out,sml;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d\n",&n);
    for(int i=1,t;i<=n;i++){
        scanf("%d",&t);
        a[t]++;
        mx=max(mx,t);
        mn=min(mn,t);
    }
    for(int i=mn;i<=mx;i++){
        if(a[i]==0) continue;
        if(sml==0){
            sml+=a[i];
            continue;
        }
        if(a[i]<=sml){
            out+=a[i];
            sml-=a[i];
        }
        else{
            out+=sml;
            sml=0;
        }
        sml+=a[i];
    }
    cout << (n-out);
    return 0;
}
